package group2.beans;

import group2.core.database.IJpaCtrl;
import group2.core.database.JpaCtrlFactory;
import group2.core.entities.CamelUser;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

/**
 * Used for showing the users "Profile page"
 * 
 * @author Christian
 */
@ManagedBean
@ViewScoped
public class ShowUserViewBean implements Serializable{

    private long id;
    private CamelUser user;
    
    
    public long getId() {
        return id;
    }

    public void setId(long id) {
        IJpaCtrl<CamelUser> userCtrl = JpaCtrlFactory.getInstance().getCamelUserCtrl();
        this.id = id;
        setUser(userCtrl.findEntity(id));
        
    }

    public CamelUser getUser() {
        return user;
    }

    public void setUser(CamelUser user) {
        this.user = user;
    }
    
    
    /** Creates a new instance of ShowUserViewBean */
    public ShowUserViewBean() {

      
    }
}
